Skip to content

Transition optimization and documentation fixes - #92

Open
Alanaktion wants to merge 2 commits into
NobleRobot:mainfrom
Alanaktion:transition-fixes
Open

Transition optimization and documentation fixes#92
Alanaktion wants to merge 2 commits into
NobleRobot:mainfrom
Alanaktion:transition-fixes

Conversation

@Alanaktion

Copy link
Copy Markdown

Thanks for making this neat li'l engine! It really makes a lot of the initial game dev tasks much easier and I love working with it. I have two small transition-related changes:

Update old TransitionType references

The old TransitionType documentation was still used in a couple of places, so I updated it to reference the new transitions. Also possibly worth changing is that the TransitionType docs page still exists but is not linked to and no longer relevant.

Optimizing transitions with tiled dithers

Based on the Playdate SDK example fast_fade.lua implementation, I've updated some of the transitions to use tiled dithers and image masks where possible to improve performance. It uses a tiled mask image for CrossDissolve, and adds a new DipTile that draws a tiled dither pattern rather than a full-screen dither. Updates DipToBlack and DipToWhite to use DipTile. The pattern images used for dithers are 8x8 to allow the larger SDK dither types to tile correctly, but could potentially be a teeny bit faster at 4x4 for the default dips.

For DipTile the max frame rate on hardware improves by 68% compared to Dip, and for CrossDissolve by 59% compared to full-screen drawFaded. Both are noticeably smoother when running games at the SDK default of 30 FPS, and no longer drop below that frame rate unless other expensive computation is happening during the transition. Tested on launch hardware (PDU-Y-01).

Uses mask image for CrossDissolve, and adds a new DipTile that draws a tiled dither pattern rather than a full-screen dither. Updates DipToBlack and DipToWhite to use DipTile.

For DipTile the max frame rate on hardware improves by 68%, and for CrossDissolve by 59%. Both are noticeably smoother when running games at the SDK default of 30 FPS, and no longer drop below that frame rate unless other expensive computation is happening during the transition. Tested on launch hardware (PDU-Y-01).
assada added a commit to assada/NobleEngine that referenced this pull request Feb 24, 2026
ericlewis added a commit to ericlewis/NobleEngine that referenced this pull request Aug 11, 2026
… stale doc references. (upstream PR NobleRobot#92)

Uses tiled 8x8 dither patterns and image masks (per the SDK's
fast_fade.lua technique) for CrossDissolve, and adds a new DipTile
base transition used by DipToBlack/DipToWhite, avoiding full-screen
400x240 faded images every frame. Also fixes stale
Noble.TransitionType doc references in Noble.lua, README.md, and
.docs/modules/Noble.html. Trailing newlines added to
CrossDissolve.lua and DipTile.lua. Applies upstream PR NobleRobot#92.

Co-authored-by: Alan <Alanaktion@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ericlewis added a commit to ericlewis/NobleEngine that referenced this pull request Aug 11, 2026
…ipTile transitions.

Cleanups for the DipTile rework from 47f83cf (upstream PR NobleRobot#92):

DipToBlack and DipToWhite defined setCustomArguments(), a method that
exists nowhere else in the transition hierarchy, so it was never called
(and would have crashed calling its nonexistent super method). This
left the documented property locks unenforced: passing tilePattern, x,
or y to these transitions overrode them, contradicting the "property is
locked" note. Rename the overrides to setProperties(), calling the
DipTile implementation and then re-asserting the locked values.

Also correct DipTile's defaultProperties @table name (a copy-paste from
Dip.lua that would collide with Dip's table in generated docs), point
the DipToBlack/DipToWhite @see references at DipTile's properties table
instead of Dip's (which documents panelImage, a property these
transitions no longer read), and rename the display name from "DipTile"
to "Dip Tile" to match the spaced naming used by every other transition.

Refs upstream PR NobleRobot#92.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ericlewis added a commit to ericlewis/NobleEngine that referenced this pull request Aug 11, 2026
Hand-patch the LDoc-generated HTML (as done in d781092 for
NobleSprite.html) to cover changes the earlier commits missed:

- Noble.html: add the missing sidebar index entry for
  Noble.performTransition (the body entry was added in 50be77b, but
  the function was undiscoverable from the nav).
- Noble.GameData.html: add sidebar and body entries for
  resetFromDisk() and resetAllFromDisk() (added in 7aa010a,
  upstream PR NobleRobot#85).
- Noble.Transition.html: replace the stale "panelImage property is
  locked" notes for DipToBlack/DipToWhite with tilePattern and point
  their See references at DipTile; add the new DipTile submodule and
  its defaultProperties table (47f83cf, upstream PR NobleRobot#92); document the
  per-invocation callback properties on the onStart/onMidpoint/
  onHoldTimeElapsed/onComplete entries (50be77b).
- NobleScene.html: add the debugColor property, enableDebug/
  disableDebug methods, and drawDebug callback (b587cd8, upstream
  PR NobleRobot#54), plus the gameWillTerminate/deviceWillSleep/deviceWillLock/
  deviceDidUnlock callbacks (b034f38, upstream issue NobleRobot#55).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ericlewis added a commit to ericlewis/NobleEngine that referenced this pull request Aug 11, 2026
… stale doc references. (upstream PR NobleRobot#92)

Uses tiled 8x8 dither patterns and image masks (per the SDK's
fast_fade.lua technique) for CrossDissolve, and adds a new DipTile
base transition used by DipToBlack/DipToWhite, avoiding full-screen
400x240 faded images every frame. Also fixes stale
Noble.TransitionType doc references in Noble.lua, README.md, and
.docs/modules/Noble.html. Trailing newlines added to
CrossDissolve.lua and DipTile.lua. Applies upstream PR NobleRobot#92.

Co-authored-by: Alan <Alanaktion@users.noreply.github.com>
ericlewis added a commit to ericlewis/NobleEngine that referenced this pull request Aug 11, 2026
…ipTile transitions.

Cleanups for the DipTile rework from 47f83cf (upstream PR NobleRobot#92):

DipToBlack and DipToWhite defined setCustomArguments(), a method that
exists nowhere else in the transition hierarchy, so it was never called
(and would have crashed calling its nonexistent super method). This
left the documented property locks unenforced: passing tilePattern, x,
or y to these transitions overrode them, contradicting the "property is
locked" note. Rename the overrides to setProperties(), calling the
DipTile implementation and then re-asserting the locked values.

Also correct DipTile's defaultProperties @table name (a copy-paste from
Dip.lua that would collide with Dip's table in generated docs), point
the DipToBlack/DipToWhite @see references at DipTile's properties table
instead of Dip's (which documents panelImage, a property these
transitions no longer read), and rename the display name from "DipTile"
to "Dip Tile" to match the spaced naming used by every other transition.

Refs upstream PR NobleRobot#92.
ericlewis added a commit to ericlewis/NobleEngine that referenced this pull request Aug 11, 2026
Hand-patch the LDoc-generated HTML (as done in d781092 for
NobleSprite.html) to cover changes the earlier commits missed:

- Noble.html: add the missing sidebar index entry for
  Noble.performTransition (the body entry was added in 50be77b, but
  the function was undiscoverable from the nav).
- Noble.GameData.html: add sidebar and body entries for
  resetFromDisk() and resetAllFromDisk() (added in 7aa010a,
  upstream PR NobleRobot#85).
- Noble.Transition.html: replace the stale "panelImage property is
  locked" notes for DipToBlack/DipToWhite with tilePattern and point
  their See references at DipTile; add the new DipTile submodule and
  its defaultProperties table (47f83cf, upstream PR NobleRobot#92); document the
  per-invocation callback properties on the onStart/onMidpoint/
  onHoldTimeElapsed/onComplete entries (50be77b).
- NobleScene.html: add the debugColor property, enableDebug/
  disableDebug methods, and drawDebug callback (b587cd8, upstream
  PR NobleRobot#54), plus the gameWillTerminate/deviceWillSleep/deviceWillLock/
  deviceDidUnlock callbacks (b034f38, upstream issue NobleRobot#55).
@ericlewis

Copy link
Copy Markdown

Nice optimization — I integrated it locally and it works well. One pre-existing bug this PR is well-placed to fix, plus two doc nits:

  1. The setCustomArguments() overrides in DipToBlack/DipToWhite are never called. (Pre-existing on main, carried forward here.) Nothing in the transition hierarchy defines or calls setCustomArguments() — the framework calls setProperties() — and transition.super.setCustomArguments(self, __arguments) would error if it were ever invoked. The practical effect: the "tilePattern property is locked" note isn't actually enforced, since passing tilePattern, x, or y in the transition properties overrides them via DipTile's setProperties(). Renaming the overrides to setProperties() (call the DipTile implementation, then re-assert the locked values) makes the lock real.

  2. DipTile.lua's defaultProperties doc table is declared as @table Noble.Transition.Dip.defaultProperties (looks like a copy-paste from Dip.lua), which collides with Dip's table in the generated docs. Relatedly, the @see Noble.Transition.Dip.defaultProperties references in DipToBlack/DipToWhite now point at a table documenting panelImage, a property these transitions no longer read.

  3. Tiny nit: transition.name = "DipTile" — the other transitions use spaced display names ("Dip to Black"), so "Dip Tile" would match the convention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants